* misclassification_check.do 12/04/19


* Counts how many workers may be misclassified because of missing health insurance information

*************************** Change log ********************************** 

/*
	
*/	


clear all
version 13.1

* Project info
cap project, doinfo
if _rc==198 {
	if c(os)=="Unix" loc master "/home/jperez/AA_Minimum_Wage" 
 else if c(username)=="J16339" loc master "B:\Col_Minimum_Wage"
 else if c(username)=="A15858" loc master "B:\Col_Minimum_Wage"
	else loc master "C:/Users/jorpp/Dropbox (Brown)/Col_Minimum_Wage"
 loc pr = 0
}
else {
	local master "`r(pdir)'"
	local doname "`r(dofile)'"  
	loc pr = 1
	* Project calls
	project, uses("`master'/Data/Source/ocupados.dta")
}



use "`master'/Data/Source/ocupados.dta"

keep if salario!=.
keep if edad<=65
keep if inrange(horas_semana,30,50)

tab trabajo_permanente time, col
gen aff= afiliado_salud
replace aff=0 if aff==2
gen css = cubierto_ss
replace css=0 if css==2
mean aff if css==1 & time==tq(1996q3) [pw=fex]
mean css if time==tq(1996q3) [pw=fex]




